﻿using System;
using System.Data;

namespace Shopping.Entities
{
    /// -----------------------------------------------------------------------------
    ///<summary>
    /// The Info class for the OrdersInfo
    /// </summary>
    /// <remarks>
    /// </remarks>
    /// <history>
    /// </history>
    /// -----------------------------------------------------------------------------
    public class OrdersInfo
    {
        #region Private Members
		
        private int _id;
        private DateTime _createDate;
        private byte  _status;
        private string _userName="";
        private decimal  _totalPrice;
        private byte  _paymentType;
        private DateTime _completeDate;
        private string _addres="";
        private string _phoneNumber="";
        private string _receiverName="";
        #endregion
        #region Constructors
        // initialization

        #endregion
        #region Public Properties
        /// <summary>
        /// Get and Set Property Data of File column Id in Table Orders 
        /// </summary>
				
        public int Id
        {
            get{ return _id; }
            set{ _id = value; }
        }
				
        /// <summary>
        /// Get and Set Property Data of File column CreateDate in Table Orders 
        /// </summary>
				
        public DateTime CreateDate
        {
            get{ return _createDate; }
            set{ _createDate = value; }
        }
				
        /// <summary>
        /// Get and Set Property Data of File column Status in Table Orders 
        /// </summary>
				
        public byte Status
        {
            get{ return _status; }
            set{ _status = value; }
        }
				
        /// <summary>
        /// Get and Set Property Data of File column UserName in Table Orders 
        /// </summary>
				
        public string UserName
        {
            get{ return _userName; }
            set{ _userName = value; }
        }
				
        /// <summary>
        /// Get and Set Property Data of File column TotalPrice in Table Orders 
        /// </summary>
				
        public decimal TotalPrice
        {
            get{ return _totalPrice; }
            set{ _totalPrice = value; }
        }
				
        /// <summary>
        /// Get and Set Property Data of File column PaymentType in Table Orders 
        /// </summary>
				
        public byte PaymentType
        {
            get{ return _paymentType; }
            set{ _paymentType = value; }
        }
				
        /// <summary>
        /// Get and Set Property Data of File column CompleteDate in Table Orders 
        /// </summary>
				
        public DateTime CompleteDate
        {
            get{ return _completeDate; }
            set{ _completeDate = value; }
        }
				
        /// <summary>
        /// Get and Set Property Data of File column Address in Table Orders 
        /// </summary>
				
        public string Addres
        {
            get{ return _addres; }
            set{ _addres = value; }
        }
				
        /// <summary>
        /// Get and Set Property Data of File column PhoneNumber in Table Orders 
        /// </summary>
				
        public string PhoneNumber
        {
            get{ return _phoneNumber; }
            set{ _phoneNumber = value; }
        }
				
        /// <summary>
        /// Get and Set Property Data of File column ReceiverName in Table Orders 
        /// </summary>
				
        public string ReceiverName
        {
            get{ return _receiverName; }
            set{ _receiverName = value; }
        }
				
        #endregion		
		
        #region IHydratable Implementation

        /// <summary>
        /// 
        /// </summary>        
        public void Fill(IDataReader oReader)
        {
            _id=int.Parse(oReader["Id"].ToString());
            _createDate=DateTime.Parse(oReader["CreateDate"].ToString());
            _status=byte.Parse(oReader["status"].ToString());
            _userName=Convert.ToString(oReader["UserName"]);
            _totalPrice=decimal.Parse(oReader["TotalPrice"].ToString());
            _paymentType=byte.Parse(oReader["PaymentType"].ToString());
            _completeDate=DateTime.Parse(oReader["CompleteDate"].ToString());
            _addres=Convert.ToString(oReader["Address"]);
            _phoneNumber=Convert.ToString(oReader["PhoneNumber"]);
            _receiverName=Convert.ToString(oReader["ReceiverName"]);
        }
        #endregion
    }
}